//封装cookie

import Cookies from 'js-cookie'
const tokenKey = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxMjMiLCJpYXQiOjE2NDUxNzk3MTUsImV4cCI6MTY1MDM2MzcxNSwiaXNzIjoiemFsIiwidXNlckFjY291bnQiOiIxMjMiLCJwZXJtaXNzaW9uIjoiVVNFUiIsInVzZXJJZCI6MX0.Kx3eGt6kJEcaNKRRjcfMJn8tNYEeLkl4FcDBLxPi1Ik'
//获取token
function getToken(){
    setToken()
    return Cookies.get('tokenKey')
}
//设置token的函数，该函数应该传个值，token写死了所以没有传值
function setToken(){
    return Cookies.set('tokenKey', tokenKey)
}
//移除token
function removeToken(){
    return Cookies.remove(tokenKey)
}

const cookie = {
    getToken,
    setToken,
    removeToken
}

export default cookie